package qq2564874169.tuaotuao.fx.app.so;

public abstract class ServiceObject {
    protected abstract void execute();

    void onExecute(ServiceContext context, Object state) {
        try {
            execute();
        } catch (Exception ex) {
            if (!onError(ex)) {
                throw ex;
            }
        }
    }

    protected boolean onError(Exception ex) {
        return false;
    }
}
